<%@ page import="cwb1.UserRegistry" %>

<html>
<head>
	<title> Log-in - Aurora </title>
	<link rel=StyleSheet href="/stylesheets/login" type="text/css" media=all>
	
	<script type="text/javascript">	
	function validateData()
	{
		
		var username = document.getElementById("username").value;
		var password = document.getElementById("password").value;
		var test;
		if (!username || !password)
			  {		  
			  	test = false;
		 	  }
		
		else
			{
			 	test = true;
			}
		
		return test;
	}	
	</script>

<style type="text/css">

</style>

	
</head>

<body>
	<div class="login_container">
	
		<div class="logo" > 	
        	<div class="image"> <a href="login.jsp"><img src="stylesheets/images/logo.png" alt="Aurora" width="288" height="120" /></a> </div>
        </div>    

        <div class="loginform">
        
			<div class="tekst1"><p> Log-in:</p> </div>
					<% 
					 	String url = "main.jsp"; 
						if(request.getParameter("url")!=null)
						{
							url = request.getParameter("url");		
						}
					
					%>
					
					<div class="invul">
					<form name="loginForm" action="/log" method="post" onSubmit="return validateData()">			
						Username:<br> <input id="username" type="text" name="username" /> <br> <br>
						
						Password:<br> <input id="password" type="password" name="password" /> <br> <br>
									  <input type="hidden" value="<%=url%>" name="url" />
						<input type="button" value="New user" onClick="window.location.href='register.jsp' " class="button"/>
       		    		<input type="submit" value="Log-in" class="button"/>
					</form> 
					
					<% 
						
						if(request.getParameter("boodschap")!=null)
						{
							String boodschap = request.getParameter("boodschap");
							%> <p> <%= boodschap %> </p> <%
						
						}
						
					%>
					</div>

		</div>
		
     </div>  
</body>
</html>